<template>
	<view class="container">
		<view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
		<view class="top-system">
			<navigator animation-type="pop-out" animation-duration="300" open-type="navigateBack" ><uni-icons type="left" size="30"></uni-icons></navigator>
			<view>
				<uni-segmented-control class="select-button" styleType="button" :current="currentIndex" :values="items"
					@clickItem="onClickItem" />
			</view>
			<view>清空</view>
		</view>
	</view>
</template>

<script setup>
import { onMounted, ref} from 'vue';
defineProps({
	currentIndex: {
		type: Number,
		default: 0
	}
})
const items = ref([
	'上传列表','下载列表'
])
const emit = defineEmits()
const onClickItem = (currentIndex) => {
	emit('changeUpload', currentIndex)
}
	
const statusBarHeight = ref(0)
onMounted(() => {
	const systemInfo = uni.getSystemInfoSync();
	statusBarHeight.value = systemInfo.statusBarHeight; //获取状态栏高度
})
</script>

<style lang="scss" scoped>
.container{
	width: 100%;
	.status-bar{
		width: 100%;
	}
	.top-system{
		padding: 2rpx 10rpx 2rpx 10rpx;
		height: 60rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	.select-button{
		width: 500rpx;
	}
}
</style>